package com.ty.service;

import com.ty.dto.Order;
import com.ty.dto.OrderQuery;
import com.ty.dto.OrderingDto;
import com.ty.dto.OrderingOk;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "order-service")
public interface IOderService {

    @PostMapping("/api/order")
    OrderingOk ordering(@RequestBody OrderingDto dto);

    @GetMapping("/api/order")
    List<Order> select(@SpringQueryMap OrderQuery query);

    @GetMapping("/api/order/sleep")
    String sleep (@RequestParam Integer time);
}
